<?php
$server  =new Swoole\Server('0.0.0.0',9502,SWOOLE_PROCESS,SWOOLE_SOCK_UDP);

//监听数据接收事件
$server->on('Packet', function ($server, $data, $clientInfo) {
    echo $data."\n";
    $server->sendto($clientInfo['address'], $clientInfo['port'], "Server ".$data);
    var_dump($clientInfo);
});

//启动服务器
$server->start();
